<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>文章列表</title>
    <link rel="stylesheet" href="./libs/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="./libs/layui-v2.6.6/css/layui.css">
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <link rel="stylesheet" href="./css/main.css">
    <script src="./libs/jquery/jquery.min.js"></script>
</head>

<body>
    <div class="container-fluid">
        <div class="common_title">
            文章列表
        </div>
        <div class="container-fluid common_con">
            <div class="row opt_btns">
                <div class="col-xs-6">
                    <div class="form-inline">
                        <input type="text" id="aname" class="form-control input-sm" placeholder="输入文章标题...">
                        <select id="selCategory" name="" class="form-control input-sm">
                            <!-- <option value="">所有分类</option>
                            <option>未分类</option>
                            <option>奇趣事</option>
                            <option>会生活</option>
                            <option>爱旅行</option> -->
                        </select>
                        <select id="selStatus" name="" class="form-control input-sm">
                            <option value="">所有状态</option>
                            <option value="草稿">草稿</option>
                            <option value="已发布">已发布</option>
                        </select>
                        <button id="btnSearch" class="btn btn-default btn-sm">
                            筛选</button>
                    </div>
                </div>
                <div class="col-xs-6">
                    <a href="./article_add.html" target="main_iframe" class="btn btn-success btn-sm pull-right" id="release_btn">
                        发表文章</a>
                </div>
            </div>
            <table class="table table-striped table-bordered table-hover mp20">
                <thead>
                    <tr>
                        <th>标题</th>
                        <th>作者</th>
                        <th>分类</th>
                        <th class="text-center">发表时间</th>
                        <th class="text-center">状态</th>
                        <th class="text-center" width="100">操作</th>
                    </tr>
                </thead>
                <tbody id="tbody">

                </tbody>
            </table>
            <div class="row text-center" id="page">
                <!-- 分页器 -->
            </div>
        </div>
    </div>
    <script src="./libs/layui-v2.6.6/layui.js"></script>
    <script src="./libs/art-template/template-web.js"></script>
    <script id="list" type="text/html">
        {{ each data }}
            <tr>
                <td>{{$value.title}}</td>
                <td>{{$value.author}}</td>
                <td>{{$value.category}}</td>
                <td class="text-center">{{ $value.date }}</td>
                <td class="text-center">{{ $value.state }}</td>
                <td class="text-center">
                    <!--页面跳转并利用href传值，
                        传值方式：
                            1、在路径后面添加问号
                            2、问号后面以键值对的形式传值
                                键名：自定义即可
                                值：就是你想传递给跳转目标页面的数据
                     -->
                    <a href="article_edit.html?id={{$value.id}}" class="btn btn-default btn-xs">编辑</a>
                    <a onclick="delFn({{ $value.id }})" href="javascript:void(0);" class="btn btn-danger btn-xs delete">删除</a>
                </td>
            </tr>
        {{ /each }}
    </script>
    <!-- 分类模板 -->
    <script id="category" type="text/html">
        <option value="">所有分类</option>
        {{ each data }}
            <option value="{{$value.id}}"> {{ $value.name }} </option>
        {{ /each}}
    </script>
    <script src="./js/config-jq.js"></script>
    <script src="./js/article_list.js"></script>
</body>

</html>